package com.hsgene.order.constants.v1;

/**
 * 物流类型枚举
 *
 * @author wangbing
 * @version 1.0, 2018/9/21
 */
public enum ExpressCompanyType {

    /**
     * 物流类型枚举
     */
    SF("sf", "顺丰快递"),

    EMS("ems", "EMS"),

    RGWL("rgwl", "人工物流"),

    UNDEFINED("undefined", "未知物流");

    private final String code;

    private final String desc;

    ExpressCompanyType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ExpressCompanyType getEnum(String code) {
        for (ExpressCompanyType type : values()) {
            if (type.getCode().equalsIgnoreCase(code)) {
                return type;
            }
        }
        return UNDEFINED;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
